Skip to content

Add SetReferenceType method to SignedXml and SignedXmlImpl (#10139) - #10212

Open
Marco Antonio Mauro (marcus905) wants to merge 1 commit into
microsoft:mainfrom
marcus905:bug/10139-signedxml-reference-type
Open

Add SetReferenceType method to SignedXml and SignedXmlImpl (#10139)#10212
Marco Antonio Mauro (marcus905) wants to merge 1 commit into
microsoft:mainfrom
marcus905:bug/10139-signedxml-reference-type

Conversation

@marcus905

@marcus905 Marco Antonio Mauro (marcus905) commented Aug 12, 2026

Copy link
Copy Markdown

What & why

Adds support for setting the Type property on an XMLDSIG Reference through the public SignedXml codeunit.

SignedXml already exposes the reference URI, digest method, and transforms, but not the underlying Reference.Type property. This prevents callers from creating XML signatures that require a typed reference, such as a reference to XAdES SignedProperties.

The change adds SetReferenceType(Type: Text) to SignedXml and its implementation, together with a unit test verifying that the configured value is emitted as the Type attribute of the generated <Reference> element.

Linked work

Fixes #10139

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)

  • Added a unit test in SignedXmlModuleTest.Codeunit.al that initializes an XMLDSIG reference, sets its Type, computes the signature, and verifies that the generated <Reference> element contains the expected Type attribute.
  • The affected Cryptography Management test module passes locally.
  • No UI changes are involved.

Risk & compatibility

Low risk. The change only adds a new public procedure and delegates it to the existing underlying .NET Reference.Type property.

There are no breaking changes, data or upgrade impacts, permission changes, telemetry changes, or feature flags.

@github-actions github-actions Bot added AL: System Application From Fork Pull request is coming from a fork Team: Integrations GitHub request for Integrations area needs-approval Workflow runs require maintainer approval to start labels Aug 12, 2026
@marcus905

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 1

Recommendation: Accept

What this PR does

This PR exposes SetReferenceType(Type: Text) on SignedXml, forwards it to SignedXml Impl., and writes the value to the underlying XML signature reference. The added test signs a document and asserts that the generated SignedInfo/Reference/@Type attribute contains the expected SignedProperties URI.

Suggestions

No blocking issues or required follow-ups found.

Risk assessment and necessity

Risk: Low. The new method is additive and leaves existing signing behavior unchanged unless callers explicitly set the reference type.

Necessity: The API fills a gap for XML signature profiles that require a typed reference, such as XAdES SignedProperties references.


[AI-PR-REVIEW] version=1 promptVersion=2 system=github pr=10212 round=1 by=alexei-dobriansky at=2026-08-26T22:08:27.4300000Z lastSha=2063121fb96bdf4b920ab7189a24f828bca8aa0f reviewKey=684d6a43bb792f1a suggestions=none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: System Application From Fork Pull request is coming from a fork needs-approval Workflow runs require maintainer approval to start Team: Integrations GitHub request for Integrations area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: SignedXml does not expose Reference.Type

3 participants